package elicecn.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 日期工具
 */
public class DateStringUtils {
	public static String getFullDateTime(Date date) {
		return getFormatedDateTime("yyyy-MM-dd HH:mm:ss", date);
	}

	public static String getFullDate(Date date) {
		return getFormatedDateTime("yyyy-MM-dd", date);
	}

	public static String getDateTimeNumber(Date date) {
		return getFormatedDateTime("yyyyMMddHHmmss", date);
	}

	public static String getDateNumber(Date date) {
		return getFormatedDateTime("yyyyMMdd", date);
	}

	public static String getFormatedDateTime(String format, Date date) {
		SimpleDateFormat dateFormat = new SimpleDateFormat(format);
		return dateFormat.format(date).toString();
	}
}
